package com.wang.interview.designmode.decorate;

/**
 * @author: wang
 * @date: 2021/7/31 17:35
 * @description:
 */
public class Decorate extends Drink {

    private Drink drink;

    public Decorate(Drink drink){
        this.drink = drink;
    }

    public void setDrink(Drink drink) {
        this.drink = drink;
    }

    public Drink getDrink() {
        return drink;
    }

    @Override
    float cost() {
        return drink.getCost() + getCost();
    }

    @Override
    public void pri(){
        System.out.println(this.getDrink().getName()+" "+this.getName()+", "+this.cost()+", "+this.getDrink().getDesc()+" "+this.getDesc());

    }


}
